var t = getApp();

Page({
    data: {
        id: "",
        pageindx: 0,
        page: 1
    },
    onLoad: function(t) {
        console.log(t), t && this.setData({
            id: t.lis
        }), this.getData();
    },
    chooseTabData: function(t) {
        console.log(t);
    },
    taplist: function(a) {
        var e = this.data.info;
        console.log(e);
        var n = a.currentTarget.dataset.ind;
        console.log(t._isTextEmpty(e[n].over)), t._isTextEmpty(e[n].over) ? e[n].over = !0 : e[n].over = !1, 
        this.setData({
            info: e
        });
    },
    onReady: function() {},
    onShow: function() {},
    onHide: function() {},
    onUnload: function() {},
    onPullDownRefresh: function() {},
    onReachBottom: function() {
        this.data.current_page >= this.data.last_page ? wx.showToast({
            title: "暂无更多",
            icon: "none",
            duration: 1e3
        }) : (this.setData({
            page: this.data.page + 1
        }), this.getNext());
    },
    onShareAppMessage: function() {},
    getData: function() {
        var a = this, e = t.getNetAddresss("plugin.team-sales.api.dividend.index");
        t._postNetWork({
            url: e,
            data: {
                dividend_type: a.data.id,
                page: this.data.page
            },
            success: function(t) {
                var e = t.data;
                1 == e.result ? (console.log(e), a.setData({
                    name: e.data.name,
                    info: e.data.data,
                    current_page: e.data.current_page,
                    last_page: e.data.last_page
                }), wx.setNavigationBarTitle({
                    title: a.data.name
                })) : (wx.showToast({
                    title: e.msg,
                    icon: "none"
                }), console.log(e.msg));
            }
        });
    },
    getNext: function() {
        var a = this, e = this, n = t.getNetAddresss("plugin.team-sales.api.dividend.index");
        t._postNetWork({
            url: n,
            data: {
                dividend_type: e.data.id,
                page: this.data.page
            },
            success: function(t) {
                var n = t.data;
                1 == n.result ? (console.log(n), e.setData({
                    info: a.data.info.concat(n.data.data),
                    current_page: n.data.current_page,
                    last_page: n.data.last_page
                })) : (wx.showToast({
                    title: n.msg,
                    icon: "none"
                }), console.log(n.msg));
            }
        });
    }
});